package auction.model;

public class Image{
	private String name;
	private String filename;
	private int sizeX;
	private int sizeY;
	
	private Item item;
	
	public Image(){
	}
	
	public Image(String n,String fn,int x,int y){
		name=n;
		filename=fn;
		sizeX=x;
		sizeY=y;
	}
	
	public boolean equals(Object obj){
		if(obj instanceof Image){
			Image other=(Image)obj;
			return filename.equals(other.filename) && sizeX==other.sizeX && sizeY==other.sizeY && name.equals(other.name);
		}else
			return false;
	}
	
	public int hashCode(){
		return filename.hashCode()+sizeX+sizeY+name.hashCode();
	}
	
	public void setName(String n){
		name=n;
	}
	public String getName(){
		return name;
	}
	
	public void setFilename(String fn){
		filename=fn;
	}
	public String getFilename(){
		return filename;
	}
	
	public void setSizeX(int x){
		sizeX=x;
	}
	public int getSizeX(){
		return sizeX;
	}
	
	public void setSizeY(int y){
		sizeY=y;
	}
	public int getSizeY(){
		return sizeY;
	}
	
	public void setItem(Item y){
		item=y;
	}
	public Item getItem(){
		return item;
	}
	
}